package site.hanzhe.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("cf_menu")
public class MenuEntity {

    @TableId(type = IdType.AUTO)
    private String id;
    private String pid;
    private String name;
    private String url;
    private String icon;
    // 用于设置标签是否展开，该字段不存在与数据库中
    @TableField(exist = false)
    private boolean open;
    // 容纳下一级菜单的集合，该字段不存在与数据库中
    @TableField(exist = false)
    private List<MenuEntity> children = new ArrayList<>();

}